package com.javacore.day4;

public class StudentDemo {

	String name;
	int age;
	boolean gender;

	public StudentDemo(String aName, int aAge, boolean aGender) {
		name = aName;
		age = aAge;
		gender = aGender;
	}
}

class ObjectTest {
	public static void main(String[] args) {
		Integer inObj1 = new Integer(1);
		Integer inObj2 = new Integer(1);
		Integer inObj3 = new Integer(5);
		// compare 2 objects
		if (inObj1.equals(inObj2)) {
			System.out.println("Obj1 equal Obj2");
		} else {
			System.out.println("Obj1 not equal Obj2");
		}

		// compare 2 objects
		if (inObj1.equals(inObj3)) {
			System.out.println("Obj1 equal Obj3");
		} else {
			System.out.println("Obj1 not equal Obj3");
		}

		StudentDemo studentCan = new StudentDemo("Nam Can", 24, true);
		System.out.println(studentCan.toString());
		System.out.println(studentCan.getClass().getName() + "@"
				+ Integer.toHexString(studentCan.hashCode()));

	}
}